package org.zoomdev.zoom.common.caster;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;

class File2InputStream implements ValueCaster {
    @Override
    public Object to(Object src) {
        File file = (File) src;
        try {
            return new FileInputStream(file);
        } catch (FileNotFoundException e) {
            throw new CasterException("Cannot open file as stream ,file not found" + file, e);
        }
    }
}